package com.wang.controller;

import com.lagou.rpc.api.IUserService;
import com.wang.annotation.RpcService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by wangq on 2021/8/29.
 */
@RestController
@RequestMapping(value = "/user")
public class UserController {
//    @Autowired
//    UserService userService;

    @RpcService
    IUserService userService;

    @GetMapping(value = "/findById/{id}")
    public String findUserById(@PathVariable int id) {
        return userService.getById(id).toString();
    }
}
